<include file="Public:header" />
<!--主体内容-->
<!--左边-->
<div class="centent_box">
    <include file="Public:left" />
    <!--右边-->
    <div class="centent_right_box">
        <div class="centent_right rightCon">
            <div class="Mtitle">
                <ul>
                    <li class="on"><span>跟进</span></li>
                </ul>
                <div class="rightWord"><a href="{:U('Used/index')}">房源管理</a> &gt;&gt; 跟进</div>
            </div>
            <form id="info_form" action=""  >
                <div class="con_div">
                    <ul class="formList width2 list_ul list_mp">
                        <li>
                            <label>房源名称：</label>
                            <input type="text"  name="data[title]" value="{$info.title}" id="title" class="inputStyle width3" readonly>
                        </li>
                        <li>
                            <label>选择户型：</label>
                            <input type="number"  name="chamber" value="{$info.chamber}" class="inputStyle used_type" style="width: 50px" min="0" max="100" value="1">
                            <span class="tip">室</span>
                            <input type="number"  name="hall" value="{$info.hall}" class="inputStyle used_type" style="width: 50px" min="0" max="100" value="0">
                            <span class="tip">厅</span>
                            <input type="number"  name="kitchen" value="{$info.kitchen}" class="inputStyle used_type" style="width: 50px" min="0" max="5" value="0">
                            <span class="tip">厨</span>
                            <input type="number"  name="toilet" value="{$info.toilet}" class="inputStyle used_type" style="width: 50px" min="0" max="5" value="0">
                            <span class="tip">卫</span>
                        </li>
                        <li>
                            <label>面积：</label>
                            <input type="text" class="inputStyle width2" value="{$info.area}" name="data[area]" maxlength="10" readonly>
                            <span class="tip">必填写项</span>
                        </li>
                        <li>
                            <label>总价：</label>
                            <input type="text" class="inputStyle width2" value="{$info.total_price}" name="data[total_price]" maxlength="10" readonly>
                            <span class="tip">元</span>
                            <label class="label1">均价：</label>
                            <input type="text" class="inputStyle width2" value="{$info.average_price}" name="data[average_price]" maxlength="10" readonly>
                            <span class="tip">元/平方米</span>
                        </li>
                        <li>
                            <label>楼栋：</label>
                            <input type="text"  name="build[alias]"  class="inputStyle width2" value="{$dict.balias}" readonly >
                            <input type="hidden"  name="build[bid]" value="{$dict.bid}">
                            <label>单元：</label>
                            <input type="text"  name="unit[alias]" class="inputStyle width2" value="{$dict.ualias}" readonly>
                            <input type="hidden"  name="unit[unid]" value="{$dict.unid}">
                            <label>门牌：</label>
                            <input type="text"  name="room[alias]" class="inputStyle width2" value="{$dict.floor}{$dict.alias}" readonly>
                            <input type="hidden"  name="room[rid]" value="{$dict.rid}">
                            <input type="hidden"  name="room[floor]" value="{$dict.floor}">
                        </li>
                        <li class="li_radio">
                            <label class="lw90">装修情况：</label>
                            <input type="radio" name="data[decorate]" id="renovation_type70" value="4" <if condition="$info['decorate'] eq 4">checked</if> ><label for="renovation_type70">豪装</label>
                            <input type="radio" name="data[decorate]" id="renovation_type68" value="3" <if condition="$info['decorate'] eq 3">checked</if> ><label for="renovation_type68">精装</label>
                            <input type="radio" name="data[decorate]" id="renovation_type67" value="2" <if condition="$info['decorate'] eq 2">checked</if> ><label for="renovation_type67">简装</label>
                            <input type="radio" name="data[decorate]" id="renovation_type69" value="1" <if condition="$info['decorate'] eq 1">checked</if> ><label for="renovation_type69">毛坯</label>
                        </li>
                        <li class="li_checkbox" id="mating">
                            <label class="lw90">房屋配套：</label>
                            <input type="checkbox" name="mating[]" id="mating1" value="1" <if condition="in_array ('1',$info['mating'])">checked</if> ><label for="mating1">冰箱</label>
                            <input type="checkbox" name="mating[]" id="mating2" value="2" <if condition="in_array ('2',$info['mating'])">checked</if> ><label for="mating2">床</label>
                            <input type="checkbox" name="mating[]" id="mating3" value="3" <if condition="in_array ('3',$info['mating'])">checked</if> ><label for="mating3">衣橱</label>
                            <input type="checkbox" name="mating[]" id="mating4" value="4" <if condition="in_array ('4',$info['mating'])">checked</if> ><label for="mating4">热水器</label>
                            <input type="checkbox" name="mating[]" id="mating5" value="5" <if condition="in_array ('5',$info['mating'])">checked</if> ><label for="mating5">沙发</label>
                            <input type="checkbox" name="mating[]" id="mating6" value="6" <if condition="in_array ('6',$info['mating'])">checked</if> ><label for="mating6">电视</label>
                            <input type="checkbox" name="mating[]" id="mating7" value="7" <if condition="in_array ('7',$info['mating'])">checked</if> ><label for="mating7">网络</label>
                            <input type="checkbox" name="mating[]" id="mating8" value="8" <if condition="in_array ('8',$info['mating'])">checked</if> ><label for="mating8">家电齐全</label>
                            <input type="checkbox" name="mating[]" id="mating9" value="9" <if condition="in_array ('9',$info['mating'])">checked</if> ><label for="mating9">家私齐全</label>
                        </li>
                        <li class="li_radio">
                            <label class="lw90">朝向：</label>
                            <input type="radio" name="room[aspect]" id="orientations109" value="10" <if condition="$info['aspect'] eq 10">checked</if> >
                            <label for="orientations109">西北</label>
                            <input type="radio" name="room[aspect]" id="orientations108" value="9" <if condition="$info['aspect'] eq 9">checked</if> >
                            <label for="orientations108">西南</label>
                            <input type="radio" name="room[aspect]" id="orientations107" value="8" <if condition="$info['aspect'] eq 8">checked</if> >
                            <label for="orientations107">东北</label>
                            <input type="radio" name="room[aspect]" id="orientations106" value="7" <if condition="$info['aspect'] eq 7">checked</if> >
                            <label for="orientations106">东南</label>
                            <input type="radio" name="room[aspect]" id="orientations105" value="6" <if condition="$info['aspect'] eq 6">checked</if> >
                            <label for="orientations105">南北</label>
                            <input type="radio" name="room[aspect]" id="orientations104" value="5" <if condition="$info['aspect'] eq 5">checked</if> >
                            <label for="orientations104">东西</label>
                            <input type="radio" name="room[aspect]" id="orientations103" value="4" <if condition="$info['aspect'] eq 4">checked</if> >
                            <label for="orientations103">北</label>
                            <input type="radio" name="room[aspect]" id="orientations102" value="3" <if condition="$info['aspect'] eq 3">checked</if> >
                            <label for="orientations102">南</label>
                            <input type="radio" name="room[aspect]" id="orientations101" value="2" <if condition="$info['aspect'] eq 2">checked</if> >
                            <label for="orientations101">西</label>
                            <input type="radio" name="room[aspect]" id="orientations100" value="1" <if condition="$info['aspect'] eq 1">checked</if> >
                            <label for="orientations100">东</label>
                        </li>

                        <li>
                            <label>建筑年代：</label>
                            <input type="text" class="inputStyle width2" value="{$info.years}" name="data[years]" maxlength="10" readonly>
                            <span class="tip">年</span>
                        </li>
                        <li>
                            <label>所在地址：</label>
                            <input type="text" class="inputStyle width3" value="{$info.address}" name="data[address]" readonly>
                        </li>
                        <li><label>特色标签：</label>
                            <input type="text" class="inputStyle width3" value="{$info.tags}"  readonly>
                        </li>
                        <li><label>房源介绍：</label>
                            <input type="text" class="inputStyle width3" name="pic" value="{$info.info}" />
                        </li>
                        <li>
                            <label>联系人 ：</label>
                            <input type="text" class="inputStyle width1" value="{$info.contacts}" name="data[contacts]" readonly>
                        </li>
                        <if condition="$view_auth">
                            <li>
                                <label>联系电话：</label>
                                <input type="text" class="inputStyle width1" value="{$info.phone}" name="data[phone]" readonly>
                            </li>
                        <else />
                            <li>
                                <label>联系电话：</label>
                                <input type="text" id="phone" class="inputStyle width1" value="点击查看" name="data[phone]" onclick="view({$info.id},'phone')" >
                            </li>
                        </if>

                    </ul>
                </div>
            </form>
            <div class="">
                <h1 style="font-size:1.5em;color:dimgrey">跟进信息：</h1>
                <ul class="follow clear">
                    <empty name="follows">
                        <li>
                            <h1>暂无跟进信息</h1>
                            <hr />
                        </li>
                    <else />
                        <volist name="follows" id="fo">
                            <li>
                                <h1>{$fo.add_time|date='Y-m-d H:i:s',###}</h1>
                                <p>{$fo.discuss} <span>{$fo.uname}</span></p>
                                <hr />
                            </li>
                        </volist>
                    </empty>
                </ul>
            </div>
            <button class="btn" id="follow">跟进</button>&nbsp;&nbsp;&nbsp;&nbsp;<button class="btn" id="deal">成交</button>
        </div>
    </div>
</div>
<script>
    $('#follow').click(function (){
        layer.open({
            type: 1,
            title:'填写信息',
            area: ['500px', '270px'],
            content: '<div style="">' +
            '<textarea id="cont" cols="79.5" rows="11" style="margin-left: 1px;"/><br/>' +
            '<button onclick="submit_btn(this)" style="margin: 10px 10px 10px 230px">提交</button>' +
            '</div>'
        });
    });
    $('#deal').click(function(){
        window.location.href = "{:U('Deal/bargain')}&id="+"{$info.id}";
    })
    function submit_btn (tar){
        var conter = $('#cont').val();
        var url = "{:U('used/follow')}";
        var user_id="{$info.user_id}",used_id="{$info.id}";
        var data = {user_id:user_id,used_id:used_id,conter:conter}
        $.post(url,data,function (reponse){
            if (reponse = 'ok'){
                layer.msg('提交成功');
                window.location.reload(1);
            }else{
                layer.msg('提交失败');
            }
        },'text');
    }
    function view (used_id,id){
        var url = "{:U('Ajax/view')}",
            data = {used_id:used_id,field:id};
        $.post(url, data, function (reponse){
            if(reponse.state = 1){
                $('#'+id).val(reponse.text);
            }else{
                $('#'+id).val('获取失败');
            }
        }, 'json');

    }
</script>

<include file="Public:footer" />